<?php

if (!empty($_SERVER['SCRIPT_FILENAME']) && 'get_address.php' == basename($_SERVER['SCRIPT_FILENAME']))
    if (!isset($_POST['longitude']))
        die('You can not access this page directly!');

require_once 'sql/get_information.php';
$longitude = trim($_POST['longitude']);
$latitude = trim($_POST['latitude']);
//获取地理位置 
$address = get_address_by_location($latitude, $longitude);
if ($address == 'GeoError' || $address =='')
    echo 'fail';
else
    echo  $address ;
?>
